﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eventModel.util.xml
{
    class Xml
    {
        public static string Escape(string xml)
        {
            return xml.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;");
        }

        public static string Unescape(string escapedXml)
        {
            return escapedXml.Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;").Replace("&", "&amp;");
        }
    }
}
